/**
 * @ author: 汪孟苹
 */
define(["jquery","bbcare",
    "scprit/followup/app/datatable/datatable.ui.js",
    "scprit/followup/app/courseReservation/courseList.servers.js"],
    function ($,$bb,$datatableUi,$courseListServers) {
    var courseList = {};

    courseList.init = function(){
        $datatableUi.init({
            "id": "courseList",
            "options": $courseListServers.getOptions()
        });  
        $courseListServers.getCourseDayOfFour({},function(data){
        	$("#courseDayOfFour").empty();
        	$.each(data.dayList,function(index,day){
        		$("#courseDayOfFour").append('<div class="dt-card form-group grid-label-4 fourDayItem"><label class="control-label">'+day+'</label></div>')
        	})
        	$(".fourDayItem").bind("click",function(){
	        	$(this).addClass("active").siblings().removeClass("active");
	        	$courseListServers.resetBtn();
	        })
       	});
        $bb.toolbar([{id:"kcyy-add",icon:"",name:"添加预约",callback:function(){
        	$courseListServers.addBespeak();
        }}]);   
    }

    return courseList;
});